function stop = h2out(tt, uu, flag, params)
  stop = 0;
  
  if (~params.plotHydro)
    return
  end

  
  if strcmp(flag, 'done')
    return
  end

  Nx = params.Nx;
  Ny = params.Ny;
  Nt = Nx.*Ny;

  tsteps = size(uu,2);
  disp(sprintf('t = %f, Nt = %d', tt(tsteps), tsteps));

  u = uu(:, tsteps);
  t = tt(:, tsteps);


 
  T  = reshape(u(0*Nt+1 : 1*Nt), Nx, Ny);
  ux = reshape(u(1*Nt+1 : 2*Nt), Nx, Ny);
  uy = reshape(u(2*Nt+1 : 3*Nt), Nx, Ny);
  if (length(u(:)) > 4*Nt)
    P1 = reshape(u(3*Nt+1 : 4*Nt), Nx, Ny);
    P2 = reshape(u(4*Nt+1 : 5*Nt), Nx, Ny);
  else
    P1 = zeros(Nx, Ny);
    P2 = zeros(Nx, Ny);
  end

  Tdx  = dx(T);
  Tdy  = dy(T);
  uxdx = dx(ux);
  uxdy = dy(ux);
  uydx = dx(uy);
  uydy = dy(uy);

  T1 = sqrt( (Tdx.^2+Tdy.^2) )./T;

  u1 = sqrt(uxdx.^2 + uxdy.^2);
  u2 = sqrt(uydx.^2 + uydy.^2);

  disp(sprintf('hydro-check: T: (%.0e, %.0e), u: (%.0e, %.0e), u2: (%.0e, %.0e)', mean(mean(T1)), max(max(T1)), mean(mean(u1)), max(max(u1)), mean(mean(u2)), max(max(u2)) ));

  w = uxdy - uydx;



  figure(1);

  plotsx = 3;
  plotsy = 2;

  function imagecsc(data)
    global cmSize;
    maxdata = max(max(abs(data)));
    data = data ./ maxdata;
    image(data.*cmSize + cmSize);
  end

  subplot(plotsy, plotsx, 1);
  T = T - params.Temp;
  imagecsc(T)
  axis square;
  meanT = mean(mean(T));
  title(sprintf('T  @  t = %.1f, DT = %.5f', t, meanT));




  fv = 1;
  subplot(plotsy, plotsx, 2);
  imagecsc(ux);
  axis square;
  maxux = max(max(abs(ux)));
  title(sprintf('ux,  max  = %.4f', maxux));

  subplot(plotsy, plotsx, 3);
  imagecsc(uy);
  axis square;
  maxuy = max(max(abs(uy)));
  title(sprintf('uy,  max  = %.4f', maxuy));

  subplot(plotsy, plotsx, 4);
  imagecsc(w);
  axis square;
  title('w auto');

  subplot(plotsy, plotsx, 6);
  imagecsc(P2);
  axis square;
  title('P2');


  pause(0.001);
  refresh();
end
